pkfanonfandomcom-20200213-history
Pikifen/Object categories/Pile
Piles are objects that contain several resources in them, that can be harvested by the Pikmin. This broad behavior allows piles to serve roles like chunks of bridge fragments, or Burgeoning Spiderworts. To create a new type of pile, please follow the creating object types tutorial. Overview Pile objects just sit there, and can be attacked by the Pikmin. Once they suffer enough damage, they give the Pikmin one of their resources. They can recharge with time, and change their look as the number of resources they have left changes. Pile type objects are hardcoded in the engine to sit there and have their health depleted, give out resources when they suffer enough damage, show how many resources they have, changed their look based on how many resources they have, and optionally disappear when they're empty. Attributes Besides the global object type attributes, a pile type requires the following attributes: *'contents': What resource they contain. Specify the name of the resource object type here. *'health_per_resource': The pile must suffer this much damage to give out the next resource. *'max_amount': At most, this pile type can only contain these many resources inside. On top of that, there are the following optional attributes: *'can_drop_multiple': If true, the pile can drop multiple resources at once in a single attack, if the damage requirements are met. This is useful if you want the pile to drop resources when struck with a bomb rock, for instance. Excess resources will not be delivered to a Pikmin, but will instead be thrown to the ground next to the pile. *'delete_when_finished': If true, the pile object is deleted when the harvesting has been done. The harvesting won't be considered finished until the last resource it had is successfully delivered. *'hide_when_empty': If true, the pile object will hide and become intangible when it has no resources at the moment. *'recharge_amount': If this pile can recharge, this specifies how many resources get added per recharge. *'recharge_interval': Specifies how often the pile recharge. If this is 0, the pile will not recharge. It will also not recharge if it's already at max capacity. *'show_amount': If true, the number of resources left in the pile will be shown above the object. *'size_animation_suffixes': If you want the pile to change animations as it changes amount, this will indicate the suffix of the animations for every given phase. This is a semicolon-separated list, and must be filled in order from empty to fullest. For example, in a pile of 10 resources max, if you want it to have an idling animation for when it's empty, and three more idling animations for the different amounts of resources it's holding, you'd set this to something like _empty; _low; _mid; _high. This would mean the idling_empty animation would be used when empty, idling_mid for when it's got 5, etc. The first will always correspond to the pile being empty, while the others are divided equally. So a pile with 20 max, split into 5 animations + empty, would change animation every 4 resources. Animations A pile type needs to have the following animations. Note that for every phase specified in the size_animation_suffixes attribute, you need another set of these animations, and each set needs to end with the corresponding suffix. *'idling': Idling; used for everything. Script A pile type's script cannot be changed. Object spawn script variables When a pile type object is spawned, it will read the following script variables, if they're present: *'amount': How many resources this starts with. Besides that, there are the global spawn script variables. Category:Pikifen